<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>精品信息</title>
    <th:block th:include="statics/common/page/header"></th:block>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row class="search-panel-space">
            <div class="search-group">
                <i-col span="5">
                	<label class="search-label-20">名称:</label>
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                    <label class="search-label-20">厂家:</label>
                    <i-input v-model="q.factory" @on-enter="query" placeholder="厂家" class="search-item-width-75"/>
                </i-col>
                <i-col span="5">
                    <label class="search-label-20">厂别:</label>
                    <i-input v-model="q.newType" @on-enter="query" placeholder="厂别" class="search-item-width-75"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row class="search-panel-space">
            <i-col span="5">
                <label class="search-label-20">品牌:</label>
                <i-input v-model="q.brand" @on-enter="query" placeholder="品牌" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">单位:</label>
                <i-input v-model="q.unit" @on-enter="query" placeholder="单位" class="search-item-width-75"/>
            </i-col>
            <i-col span="5">
                <label class="search-label-20">状态:</label>
                <i-select v-model="q.state" class="search-item-width-75">
                    <i-option :value="0">编辑</i-option>
                    <i-option :value="1">下架</i-option>
                    <i-option :value="2">上架</i-option>
                </i-select>
            </i-col>
        </Row>
        <Row :gutter="16">
            <div class="buttons-group">
                <i-button type="info" @click="add" th:if="${@shiroAuthService.hasPermission('productboutique:save')}">
                	<i class="fa fa-plus"></i>&nbsp;新增</i-button>
                <i-button type="warning" @click="update" th:if="${@shiroAuthService.hasPermission('productboutique:update')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                <i-button type="warning" @click="startSale" th:if="${@shiroAuthService.hasPermission('productboutique:sale')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;上架</i-button>
                <i-button type="warning" @click="endStore" th:if="${@shiroAuthService.hasPermission('productboutique:store')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;下架</i-button>
                <i-button type="error" @click="del" th:if="${@shiroAuthService.hasPermission('productboutique:delete')}">
                	<i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
            </div>
        </Row>
	    <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="productBoutique" :rules="ruleValidate" :label-width="80">
            <Form-item label="编码" prop="code">
                <i-input v-model="productBoutique.code" placeholder="编码"/>
            </Form-item>
            <Form-item label="名称" prop="name">
                <i-input v-model="productBoutique.name" placeholder="名称"/>
            </Form-item>
            <!-- <Form-item label="所属分类" prop="classifyId" style="width:50%;">
                <i-input type="text" v-model="productBoutique.classifyName" icon="eye" readonly="readonly"
                         @on-click="productClassifyTree" placeholder="所属分类"/>
            </Form-item> -->
            <Form-item label="生产厂家" prop="factory">
                <i-input v-model="productBoutique.factory" placeholder="生产厂家"/>
            </Form-item>
            <Form-item label="厂别" prop="newType">
                <i-input v-model="productBoutique.newType" placeholder="厂别（原厂、副厂）"/>
            </Form-item>
            <Form-item label="品牌" prop="brand">
                <i-input v-model="productBoutique.brand" placeholder="品牌"/>
            </Form-item>
            <Form-item label="单位" prop="unit">
                <i-input v-model="productBoutique.unit" placeholder="单位"/>
            </Form-item>
            <Form-item label="价格" prop="price">
                <i-input v-model="productBoutique.price" placeholder="价格"/>
            </Form-item>
            <Form-item label="备注" prop="content" >
                <i-input type="textarea" v-model="productBoutique.content" placeholder="备注"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>
<div id="productClassifyLayer" style="display: none;padding:10px;">
    <ul id="productClassifyTree" class="ztree"></ul>
</div>
<script th:src="@{../statics/js/product/productboutique.js}"></script>
</body>
</html>